package com.lzj.demo.design.chain.fzw;

import cn.hutool.json.JSONUtil;
import com.lzj.demo.design.chain.fzw.chain.*;
import lombok.extern.slf4j.Slf4j;

import java.text.ParseException;
import java.util.Date;

@Slf4j
public class Test {
    public static void main(String[] args) throws ParseException {
        AuthController authController = new AuthController();
        //模拟三级负责人审批
        log.info("测试结果:{}", JSONUtil.toJsonStr(authController.doAuth("1A", "2001", new Date())));
        AuthService.auth("1003", "2001");
        //模拟二级负责人审批
        log.info("测试结果:{}", JSONUtil.toJsonStr(authController.doAuth("2B", "2001", new Date())));
        AuthService.auth("1002", "2001");
        //模拟一级负责人审批
        log.info("测试结果:{}", JSONUtil.toJsonStr(authController.doAuth("3C", "2001", new Date())));
        AuthService.auth("1001", "2001");
        log.info("测试结果:{}", "审批完成");
    }
}
